package kr.hkit.powerjava.chapter06;

import java.util.Scanner;

public class Pro5 {
	public static void main(String[] args) {
		double x;
		
		Scanner input = new Scanner(System.in);
		System.out.print("x의 값을 입력하시오. ");
		x = input.nextDouble();
		
		if (x <= 0)
			System.out.println(x * x * x - 9 * x + 2);
		else
			System.out.println(7 * x + 2);
	}

}
